﻿using System;
using System.Collections.Generic;

/* 输入10个整数，输出最大数和最小数 */
namespace Practice4
{
    public class Practice
    {
        static (int max, int min) GetMaxAndMin(List<int> list)
        {
            list.Sort();
            int max = list[list.Count - 1];
            int min = list[0];
            return (max, min);
        }

        public static void Excute()
        {
            Console.Write("请输入10个整数: ");
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(" "), s => int.Parse(s));
            List<int> list = new List<int> { };
            list.AddRange(arr);
            var (max, min) = GetMaxAndMin(list);
            Console.WriteLine("{0} {1}", max, min);
        }
    }
}
